package spring.angularjs.domain;

// Generated Oct 27, 2014 1:40:02 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Transaction generated by hbm2java
 */
@Entity
@Table(name = "transaction", catalog = "finalproject")
public class Transaction implements java.io.Serializable {

	private String idtransaction;
	private Statustransaction statustransaction;
	private Account accountByIdAccountReceive;
	private Account accountByIdAccountSent;
	private String idCustomerSent;
	private String isCustomerReceive;
	private Date datetransaction;
	private String amount;
	private String statusreport;
	private Set<Reporttransaction> reporttransactions = new HashSet<Reporttransaction>(
			0);

	public Transaction() {
	}

	public Transaction(String idtransaction,
			Statustransaction statustransaction,
			Account accountByIdAccountReceive, Account accountByIdAccountSent,
			String idCustomerSent, String isCustomerReceive,
			Date datetransaction, String amount, String statusreport) {
		this.idtransaction = idtransaction;
		this.statustransaction = statustransaction;
		this.accountByIdAccountReceive = accountByIdAccountReceive;
		this.accountByIdAccountSent = accountByIdAccountSent;
		this.idCustomerSent = idCustomerSent;
		this.isCustomerReceive = isCustomerReceive;
		this.datetransaction = datetransaction;
		this.amount = amount;
		this.statusreport = statusreport;
	}

	public Transaction(String idtransaction,
			Statustransaction statustransaction,
			Account accountByIdAccountReceive, Account accountByIdAccountSent,
			String idCustomerSent, String isCustomerReceive,
			Date datetransaction, String amount, String statusreport,
			Set<Reporttransaction> reporttransactions) {
		this.idtransaction = idtransaction;
		this.statustransaction = statustransaction;
		this.accountByIdAccountReceive = accountByIdAccountReceive;
		this.accountByIdAccountSent = accountByIdAccountSent;
		this.idCustomerSent = idCustomerSent;
		this.isCustomerReceive = isCustomerReceive;
		this.datetransaction = datetransaction;
		this.amount = amount;
		this.statusreport = statusreport;
		this.reporttransactions = reporttransactions;
	}

	@Id
	@Column(name = "idtransaction", unique = true, nullable = false, length = 45)
	public String getIdtransaction() {
		return this.idtransaction;
	}

	public void setIdtransaction(String idtransaction) {
		this.idtransaction = idtransaction;
	}

	@ManyToOne
	@JoinColumn(name = "statustransactionid", nullable = false)
	public Statustransaction getStatustransaction() {
		return this.statustransaction;
	}

	public void setStatustransaction(Statustransaction statustransaction) {
		this.statustransaction = statustransaction;
	}

	@ManyToOne
	@JoinColumn(name = "id_account_receive", nullable = false)
	public Account getAccountByIdAccountReceive() {
		return this.accountByIdAccountReceive;
	}

	public void setAccountByIdAccountReceive(Account accountByIdAccountReceive) {
		this.accountByIdAccountReceive = accountByIdAccountReceive;
	}

	@ManyToOne
	@JoinColumn(name = "id_account_sent", nullable = false)
	public Account getAccountByIdAccountSent() {
		return this.accountByIdAccountSent;
	}

	public void setAccountByIdAccountSent(Account accountByIdAccountSent) {
		this.accountByIdAccountSent = accountByIdAccountSent;
	}

	@Column(name = "id_customer_sent", nullable = false, length = 45)
	public String getIdCustomerSent() {
		return this.idCustomerSent;
	}

	public void setIdCustomerSent(String idCustomerSent) {
		this.idCustomerSent = idCustomerSent;
	}

	@Column(name = "is_customer_receive", nullable = false, length = 45)
	public String getIsCustomerReceive() {
		return this.isCustomerReceive;
	}

	public void setIsCustomerReceive(String isCustomerReceive) {
		this.isCustomerReceive = isCustomerReceive;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "datetransaction", nullable = false, length = 10)
	public Date getDatetransaction() {
		return this.datetransaction;
	}

	public void setDatetransaction(Date datetransaction) {
		this.datetransaction = datetransaction;
	}

	@Column(name = "amount", nullable = false, length = 45)
	public String getAmount() {
		return this.amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	@Column(name = "statusreport", nullable = false, length = 45)
	public String getStatusreport() {
		return this.statusreport;
	}

	public void setStatusreport(String statusreport) {
		this.statusreport = statusreport;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "transaction")
	public Set<Reporttransaction> getReporttransactions() {
		return this.reporttransactions;
	}

	public void setReporttransactions(Set<Reporttransaction> reporttransactions) {
		this.reporttransactions = reporttransactions;
	}

}
